@*
* Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0
* See accompanying LICENSE file.
*@
@import scalaz.{\/}
@(theMenu: Html,
  crumbs: IndexedSeq[models.navigation.BreadCrumbs.BreadCrumbRendered],
  errorOrSuccess: kafka.manager.ApiError \/ Any,
  actionTitle: String,
  successLink: models.FollowLink,
  errorLink: models.FollowLink)(implicit messages: play.api.i18n.Messages, request:RequestHeader)

@link(followLink: FollowLink) = {
    <div class="alert alert-success" role="alert">Done!</div>
    <div class="alert alert-info" role="alert">
        <a href="@followLink.url">@followLink.title</a>
    </div>
}

@main(actionTitle, menu = theMenu, breadcrumbs = views.html.navigation.breadCrumbs(crumbs)) {

    <div class="col-md-6 un-pad-me">
        <div class="card">
            <div class="card-header"><h3>@actionTitle</h3></div>
            <div class="card-body">
            @errorOrSuccess.fold( a => views.html.errors.onApiError(a, Some(errorLink)) , b => link(successLink))
            </div>
        </div>
    </div>

}
